package com.example.sharpshopdemo.controller;

import com.example.sharpshopdemo.entity.Result;
import com.example.sharpshopdemo.entity.User;


import com.example.sharpshopdemo.service.UserService;
import com.example.sharpshopdemo.service.impl.UserServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {


    @Autowired
    private UserService service;

    @GetMapping("/list")
    public Result list() {
        return service.getAll();
    }

    @PostMapping("/add")
    @Operation(summary = "添加用户")
    public User add(){
        return new User();
    }


}
